import request from '@/utils/request'

// 查询服务器列表
export function listServer_manage(query) {
  return request({
    url: '/yipaiju/server_manage/list',
    method: 'get',
    params: query
  })
}

// 查询服务器详细
export function getServer_manage(id) {
  return request({
    url: '/yipaiju/server_manage/' + id,
    method: 'get'
  })
}

// 新增服务器
export function addServer_manage(data) {
  return request({
    url: '/yipaiju/server_manage',
    method: 'post',
    data: data
  })
}

// 修改服务器
export function updateServer_manage(data) {
  return request({
    url: '/yipaiju/server_manage',
    method: 'put',
    data: data
  })
}

// 删除服务器
export function delServer_manage(id) {
  return request({
    url: '/yipaiju/server_manage/' + id,
    method: 'delete'
  })
}

export function serverAddprov(id) {
  return request({
    url: '/yipaiju/server_manage/serverAddprov/' + id,
    method: 'get'
  })
}

export function serverAdddetail(query) {
  return request({
    url: '/yipaiju/server_manage/serverAdddetail/' + query.id,
    method: 'get',
    params: query
  })
}

export function serverClearQueue(query) {
  return request({
    url: '/yipaiju/server_manage/clearQueue/' + query.id,
    method: 'get',
    params: query
  })
}

export function serverSpiderArrange(id) {
  return request({
    url: '/yipaiju/server_manage/spiderArrange/' + id,
    method: 'get'
  })
}

export function serverSpiderArranges(ids) {
  return request({
    url: '/yipaiju/server_manage/spiderArranges/' + ids,
    method: 'delete'
  })
}

export function serverSynchQueue(id) {
  return request({
    url: '/yipaiju/server_manage/synchQueue/' + id,
    method: 'get'
  })
}

export function serverSpiderStart(id) {
  return request({
    url: '/yipaiju/server_manage/spiderStart/' + id,
    method: 'get'
  })
}

export function serverSpiderShutdown(id) {
  return request({
    url: '/yipaiju/server_manage/spiderShutdown/' + id,
    method: 'get'
  })
}

export function serverSpiderShutdowns(ids) {
  return request({
    url: '/yipaiju/server_manage/spiderShutdowns/' + ids,
    method: 'delete'
  })
}
